/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bash.carrep.dao.enties;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author p.bashizi
 */
@Entity
@Table(name = "typedeclaration", catalog = "carrepdb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Typedeclaration.findAll", query = "SELECT t FROM Typedeclaration t"),
    @NamedQuery(name = "Typedeclaration.findByIdtypeDeclaration", query = "SELECT t FROM Typedeclaration t WHERE t.idtypeDeclaration = :idtypeDeclaration"),
    @NamedQuery(name = "Typedeclaration.findByDescription", query = "SELECT t FROM Typedeclaration t WHERE t.description = :description")})
public class Typedeclaration implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idtypeDeclaration", nullable = false)
    private Integer idtypeDeclaration;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "description", nullable = false, length = 45)
    private String description;

    public Typedeclaration() {
    }

    public Typedeclaration(Integer idtypeDeclaration) {
        this.idtypeDeclaration = idtypeDeclaration;
    }

    public Typedeclaration(Integer idtypeDeclaration, String description) {
        this.idtypeDeclaration = idtypeDeclaration;
        this.description = description;
    }

    public Integer getIdtypeDeclaration() {
        return idtypeDeclaration;
    }

    public void setIdtypeDeclaration(Integer idtypeDeclaration) {
        this.idtypeDeclaration = idtypeDeclaration;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtypeDeclaration != null ? idtypeDeclaration.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Typedeclaration)) {
            return false;
        }
        Typedeclaration other = (Typedeclaration) object;
        if ((this.idtypeDeclaration == null && other.idtypeDeclaration != null) || (this.idtypeDeclaration != null && !this.idtypeDeclaration.equals(other.idtypeDeclaration))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bash.carrep.dao.enties.Typedeclaration[ idtypeDeclaration=" + idtypeDeclaration + " ]";
    }
    
}
